package com.tcdp.models;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the blog_post_comment_tbl database table.
 * 
 */
@Entity
@Table(name="blog_post_comment_tbl")
public class BlogPostComment extends AbstractModel implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="blog_post_comment_id")
	private int blogPostCommentId;

	@Lob
	@Column(name="blog_post_comment_content")
	private String blogPostCommentContent;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="blog_post_comment_date")
	private Date blogPostCommentDate;

	@Column(name="blog_post_comment_eadd")
	private String blogPostCommentEadd;

	@Column(name="blog_post_comment_name")
	private String blogPostCommentName;

	//bi-directional many-to-one association to BlogPostComment
	@ManyToOne
	@JoinColumn(name="blog_post_comment_parent_id")
	private BlogPostComment blogPostCommentParent;

	//bi-directional many-to-one association to BlogPostComment
	@OneToMany(mappedBy="blogPostCommentParent")
	private List<BlogPostComment> blogPostCommentChildren;

	//bi-directional many-to-one association to BlogPost
	@ManyToOne
	@JoinColumn(name="blog_post_id")
	private BlogPost blogPost;

	public BlogPostComment() {
	}

	public int getBlogPostCommentId() {
		return this.blogPostCommentId;
	}

	public void setBlogPostCommentId(int blogPostCommentId) {
		this.blogPostCommentId = blogPostCommentId;
	}

	public String getBlogPostCommentContent() {
		return this.blogPostCommentContent;
	}

	public void setBlogPostCommentContent(String blogPostCommentContent) {
		this.blogPostCommentContent = blogPostCommentContent;
	}

	public Date getBlogPostCommentDate() {
		return this.blogPostCommentDate;
	}

	public void setBlogPostCommentDate(Date blogPostCommentDate) {
		this.blogPostCommentDate = blogPostCommentDate;
	}

	public String getBlogPostCommentEadd() {
		return this.blogPostCommentEadd;
	}

	public void setBlogPostCommentEadd(String blogPostCommentEadd) {
		this.blogPostCommentEadd = blogPostCommentEadd;
	}

	public String getBlogPostCommentName() {
		return this.blogPostCommentName;
	}

	public void setBlogPostCommentName(String blogPostCommentName) {
		this.blogPostCommentName = blogPostCommentName;
	}

	public BlogPostComment getBlogPostCommentParent() {
		return this.blogPostCommentParent;
	}

	public void setBlogPostCommentParent(BlogPostComment blogPostCommentParent) {
		this.blogPostCommentParent = blogPostCommentParent;
	}

	public List<BlogPostComment> getBlogPostCommentChildren() {
		return this.blogPostCommentChildren;
	}

	public void setBlogPostCommentChildren(List<BlogPostComment> blogPostCommentChildren) {
		this.blogPostCommentChildren = blogPostCommentChildren;
	}

	public BlogPost getBlogPost() {
		return this.blogPost;
	}

	public void setBlogPost(BlogPost blogPost) {
		this.blogPost = blogPost;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + blogPostCommentId;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BlogPostComment other = (BlogPostComment) obj;
		if (blogPostCommentId != other.blogPostCommentId)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "BlogPostComment [blogPostCommentId=" + blogPostCommentId
				+ ", blogPostCommentContent=" + blogPostCommentContent
				+ ", blogPostCommentDate=" + blogPostCommentDate
				+ ", blogPostCommentEadd=" + blogPostCommentEadd
				+ ", blogPostCommentName=" + blogPostCommentName
				+ ", blogPostCommentParent=" + blogPostCommentParent
				+ ", blogPostCommentChildren=" + blogPostCommentChildren
				+ ", blogPost=" + blogPost + "]";
	}

}